package app.qrcode.browser.chat.model

import app.qrcode.browser.chat.MyApplication.Companion.context
import app.qrcode.browser.chat.model.bean.UserInfo
import app.qrcode.browser.chat.model.dao.UserAccountDao
import app.qrcode.browser.chat.model.db.DBManager
import java.util.concurrent.ExecutorService
import java.util.concurrent.Executors

/**
 * Created by DomenCai on 2022/3/10.
 */
object Model {

        lateinit var dbManager: DBManager
        val executors: ExecutorService = Executors.newCachedThreadPool()
        val userAccountDao = UserAccountDao(context)
        fun loginSuccess(account: UserInfo?) {
            if (account == null) {
                return
            }
            dbManager = DBManager(context,account.hxId)
            if (dbManager != null) {
                dbManager.close()
            }

        }
    }

